//
//  TargetViewController.m
//  AppShellTool
//
//  Created by IOS01 on 2022/12/2.
//

#import "TargetViewController.h"
#import "LuanchHeader.h"

@interface TargetViewController ()

@end

@implementation TargetViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self initUI];
    
}

- (void)initUI{
    
    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(100, 100, 100, 45)];
    [btn setTitle:@"退出" forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchDown];
    btn.backgroundColor = [UIColor grayColor];
    [self.view addSubview:btn];
    
    
    UIButton *push = [[UIButton alloc] initWithFrame:CGRectMake(100, 200, 100, 45)];
    [push setTitle:@"跳转" forState:UIControlStateNormal];
    [push addTarget:self action:@selector(pushVc:) forControlEvents:UIControlEventTouchDown];
    push.backgroundColor = [UIColor grayColor];
    [self.view addSubview:push];
}

- (void)back:(UIButton *)btn{
    NSString *class = NSStringFromClass(self.navigationController.class);
    NSLog(@"%@",class);
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
//    [self.navigationController popToRootViewControllerAnimated:YES];
}

- (void)pushVc:(UIButton *)btn{
    
    [self.navigationController pushViewController:[TargetViewController new] animated:YES];
}

- (void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    [[SocketClient shareClient] sendMsg:@"这是一个测试网页"];
}

@end
